﻿<Window x:Class="ParanoidMike.CacheMyWork.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="CacheMyWork" 
        Height="Auto" Width="525" 
        Icon="/CacheMyWork;component/CacheMyWork.ico">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />            
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" Name="MenuStripRow"/>
            <RowDefinition Height="Auto" Name="ChecklistOfAppsRow" MinHeight="100" />
            <RowDefinition Height="Auto" Name="ButtonsRow"/>
            <!--<RowDefinition Height="Auto" Name="StatusBarRow"/>-->
        </Grid.RowDefinitions>

        <Menu Name="MenuBar"
              HorizontalAlignment="Stretch"
              VerticalAlignment="Top"
              Grid.Row="0"
              Grid.Column="0">
            <MenuItem Header="File" />
            <MenuItem Header="Tools" />
            <MenuItem Header="Help" />
        </Menu>

        <GroupBox Header="Your Cacheable Applications"
                  Grid.Row="1"
                  Grid.Column="0">
            <!--<ListBox x:Name="AppsList"
                     ItemsSource="{Binding processDescriptiveName, ElementName=cacheableProcesses}"
                     >-->
            <!--<ListBox Name="AppsList">
                <ListBox.ItemTemplate>
                    <HierarchicalDataTemplate>
                        <CheckBox Content="{Binding processDescriptiveName}" IsChecked="{Binding IsChecked}"/>
                    </HierarchicalDataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>-->
            <DataGrid Name="AppsList" 
                      ItemsSource="{Binding}" 
                      AutoGenerateColumns="False" 
                      CanUserAddRows="False"
                      CanUserResizeRows="False"
                      CanUserSortColumns="True">
                <DataGrid.Columns>
                    <DataGridTemplateColumn Header="Process Name" Width="SizeToCells" IsReadOnly="True">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Name="ProcessName" Text="{Binding Path=ProcessName}" />
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Header="Description" Width="SizeToCells" IsReadOnly="True">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Name="DescriptiveName" Text="{Binding Path=ProcessDescriptiveName}" />
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Header="Command Line" Width="SizeToCells" IsReadOnly="True">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Name="CommandLine" Text="{Binding Path=ProcessCommandLine}" />
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
            </DataGrid>
            
        </GroupBox>

        <StackPanel Orientation="Horizontal"
                    Grid.Row="2"
                    Grid.Column="0">
            <!-- StackPanel used to have multiple buttons e.g. ClearRegistry & Save -->

            <Button Name="btnOK"
                    Width="50"
                    Height="25"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Margin="10"
                    Click="btnOK_Click">
                <TextBlock Text="Save" />
            </Button>

        </StackPanel>
                
    </Grid>
</Window>
